package com.ihai.spring.boot.sample.distributed.counter.listener;

import com.ihai.spring.boot.sample.distributed.counter.remote.Node;
import org.springframework.context.ApplicationEvent;

import java.util.ArrayList;
import java.util.List;

/**
 * DESC
 *
 * @author 张驰
 * @date 2019/12/26
 */
public class NodeChangeEvent extends ApplicationEvent {

    private List<String> clusters = new ArrayList<>();
    private String current;
    /**
     * Create a new ApplicationEvent.
     *
     * @param source the object on which the event initially occurred (never {@code null})
     */
    public NodeChangeEvent(Object source, List<String> clusters, String current) {
        super(source);
        this.clusters = clusters;
        this.current = current;
    }

    public List<String> getClusters(){
        return this.clusters;
    }

    public String getCurrent(){
        return this.current;
    }

}
